from django.db import models


# Create your models here.


class UserInfo(models.Model):
    username = models.CharField(verbose_name='用户名', max_length=32)
    password = models.CharField(verbose_name='密码', max_length=32)
    email = models.EmailField(verbose_name='邮箱', max_length=32)
    mobile_phone = models.CharField(verbose_name='手机号', max_length=32)

class Accelerator(models.Model):
    """加速器信息表"""
    fe = models.ForeignKey(to="UserInfo",to_field="username",on_delete=models.CASCADE)
    de = models.ForeignKey(to="UserInfo",to_field="mobile_phone",on_delete=models.CASCADE)#数据列的名称是：de_mobile_phone
    residue_timenum = models.IntegerField(verbose_name="剩余时间")

